package com.wanxi;

import java.util.Scanner;

public class RunChenMing {
    public static void main(String[] args) {
        String information = getInformation("请输入打印的信息： ");
        int num = getNumber("请输入打印次数： ");
        soutIfon(num, information);

    }


    /**
     * 得到键盘输入的一个整数
     *
     * @return
     */
    private static int getNumber(String tips) {
        Scanner scanner = new Scanner(System.in);
        System.out.print(tips);
        int num = scanner.nextInt();

        return num;
    }

    /**
     * 得到键盘输入的信息
     *
     * @param tips
     * @return
     */
    private static String getInformation(String tips) {
        Scanner scanner = new Scanner(System.in);
        System.out.print(tips);
        String information = scanner.next();

        return information;

    }

    /**
     * 打印n次信息
     *
     * @param n
     * @param information
     */
    private static void soutIfon(int n, String information) {
        for (int i = 0; i < n; i++) {
            System.out.println(information);

        }

    }
}
